Skip to content

backend initial state#1

Merged
dazakdev merged 2 commits into
masterfrom
backend
Dec 6, 2025
Merged

backend initial state#1
dazakdev merged 2 commits into
masterfrom
backend

Conversation

@dazakdev

@dazakdev dazakdev commented Dec 6, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Co-authored-by: Robert Raniszewski <raniszewski-robert@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the initial backend implementation for a ZUS (Polish Social Insurance Institution) accident reporting assistant. The backend uses FastAPI to provide a conversational API that helps users fill out accident report forms through natural language interaction, powered by Google's Gemini AI model via LangChain.

Key Changes

  • FastAPI-based REST API with a conversational assistant endpoint for accident report data collection
  • Integration with Google Gemini AI for natural language understanding and structured data extraction
  • Pydantic models for type-safe case state management and API contracts

Reviewed changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
backend/pyproject.toml Project configuration with Python 3.12.11+ requirement and key dependencies (FastAPI, LangChain, Google Generative AI)
backend/uv.lock Complete dependency lock file with 1000+ lines of pinned package versions
backend/main.py Core application logic including FastAPI app, Pydantic models, LLM integration, and assistant pipeline
backend/.env.example Environment variable template for API keys and configuration
backend/.python-version Python version specification (3.12.11)
.gitignore Git ignore patterns for environment files and Python cache

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/main.py
Comment on lines +105 to +115
def get_llm() -> Optional[Any]:
"""
Prosty factory na LLM-a.
Jeśli LangChain/Gemini nie są zainstalowane, zwracamy None,
a pipeline zadziała w trybie fallback (bez LLM).
"""
# Możesz sterować modelem przez ENV: GEMINI_MODEL=gemini-1.5-flash
return ChatGoogleGenerativeAI(
model=os.getenv("GEMINI_MODEL", "gemini-2.5-flash"),
temperature=0,
)

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API key is exposed in the environment variable without any validation. Consider adding a check at application startup to ensure GOOGLE_API_KEY is set, and fail fast with a clear error message if it's missing. This helps developers identify configuration issues early.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread backend/main.py Outdated

Copilot AI commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

@GrabowskiDev I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dazakdev dazakdev merged commit 86990db into master Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants